// Array.prototype.includes(searchElement,fromIndex)
// includes VS indexOf
// const arr =['es6','es7','es8']
// console.log(arr.includes('es7'));//true
// console.log(arr.includes('es9'));//falae
// console.log(arr.includes('es7',1));//true
// console.log(arr.includes('es7',2));//false
// console.log(arr.includes('es7',-1));//false
// console.log(arr.includes('es7',-2));//true

// const arr =['es6','es7','es8']
// console.log(arr.indexOf('es7'));//1
// console.log(arr.indexOf('es7')>-1);//true


// indexOf和includes都只能用于判断查找的值为简单类型的，如果判断的元素为引用类型不行
// const arr =['es6',['es7','es8'],'es9']
// console.log(arr.indexOf(['es7','es8']));//-1
// console.log(arr.includes(['es7','es8']));//false

// 判断NaN
const arr =['es6',NaN,'es9']
console.log(arr.indexOf(NaN));//-1
console.log(arr.includes(NaN));//TRUE




